<?php ob_start(); ?> 
<?php header ('Content-type: text/xml; charset=utf-8'); ?>     

<?php include "constants.inc" ?>

<?php include "classes.inc" ?>

<?php session_start(); ?>

<?php

function storeHomeTeam($homeTeam) {

	if (isset($_GET['homeTeam'])) {

  		$homeTeam = $_GET['homeTeam'];

		mysql_connect(DB_SERVER, DB_USER, DB_PWD);

    	mysql_select_db(DB_CATALOG);

	  	$query = "select team_id from zt_team te

	  		join zt_tournament t on t.tournament_id = te.tournament_id

	  		where t.iscurrent = 1 and team_name = '".$homeTeam."'";

	  	$result = mysql_query($query);

	  	$record = mysql_fetch_assoc($result);

    	$_SESSION['homeTeam'] = $record['team_id'];

    	return '1';

 	}

  	return '0';

}

?>

<response>

  <method>storeHomeTeam</method>

  <result><?php

    echo storeHomeTeam()?></result>

</response>